<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=1200, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="myDiv" name="div1" class='test1'>
        <p id="myPara">test</p>
    </div>
    <script>
        const oDiv = document.getElementById('myDiv')
        const oDiv1 = document.getElementsByName('div1')
        const oDiv2 = document.getElementsByTagName('div')
        const oDiv3 = document.getElementsByClassName('test1')
        const oDiv4 = document.querySelector('#myDiv')
        const oDiv5 = document.querySelectorAll('#myDiv')
        console.log(oDiv,oDiv1,oDiv2,oDiv3)
        console.log(oDiv4,oDiv5)
        const oPara = oDiv.querySelector('#myPara')
    </script>
</body>
</html>